import req from "../../utils/request";
import qs from 'qs'

//查询用户列表
export function get_userList(query) {
  return req({
    url: "/api/getUserListByPage",
    method: "get",
    params: query,
  });
}

//下拉角色查询
export function get_roleList(query) {
  return req({
    url: "/api/getRoleList",
    method: "get",
    params: query,
  });
}

//获取当前用户登录信息
export function get_loginUserInfo(query) {
  return req({
    url: "/api/getLoginUserInfo",
    method: "get",
    params: query,
  });
}

//厂家下拉框
export function get_VendorList(query) {
  return req({
    url: "/api/getVendorList",
    method: "get",
    params: query,
  });
}

//厂查询厂家赋权组件左表
export function get_getLeftPv(query) {
  return req({
    url: "/api/getLeftPv",
    method: "get",
    params: query,
  });
}

//厂查询厂家赋权应用左表
export function get_getLeftAv(query) {
  return req({
    url: "/api/getLeftAv",
    method: "get",
    params: query,
  });
}

//厂查询厂家赋权组件右表
export function get_getRightPv(query) {
  return req({
    url: "/api/getRightPv",
    method: "get",
    params: query,
  });
}

//厂查询厂家赋权应用右表
export function get_getRightAv(query) {
  return req({
    url: "/api/getRightAv",
    method: "get",
    params: query,
  });
}

//查询用户列表
export function add_user(query) {
  return req({
    url: "/api/addUser",
    method: "post",
    data: query,
  });
}

//删除用户列表
export function del_user(query) {
  return req({
    url: `/api/delUser`,
    method: "delete",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//剔除用户下线
export function put_quitUser(query) {
  return req({
    url: `/api/quitUser`,
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//厂家组件赋权
export function put_addPv(query) {
  return req({
    url: `/api/addPv`,
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//厂家组件赋权
export function put_addAv(query) {
  return req({
    url: `/api/addAv`,
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//剔除用户下线
export function put_resetPassword(query) {
  return req({
    url: `/api/resetPassword`,
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//修改密码
export function put_editPassword(query) {
  return req({
    url: `/api/editPassword`,
    method: "put",
    data: qs.stringify(query),
  });
}

//修改用户信息
export function put_editUserInfo(query) {
  return req({
    url: `/api/editUser`,
    method: "put",
    data: qs.stringify(query),
  });
}

//获取角色列表
export function get_RoleListByPage(query) {
  return req({
    url: "/api/getRoleListByPage",
    method: "get",
    params: query,
  });
}

//角色权限查询
export function get_getRoleTree(query) {
  return req({
    url: "/api/getRoleTree",
    method: "get",
    params: query,
  });
}

//角色新增
export function put_roleAdd(query) {
  return req({
    url: `/api/roleAdd`,
    method: "put",
    data: qs.stringify(query),
  });
}

//角色新增
export function put_roleedi(query) {
  return req({
    url: `/api/roleEdit`,
    method: "put",
    data: qs.stringify(query),
  });
}

//删除角色
export function del_roleDel(query) {
  return req({
    url: `/api/roleDel`,
    method: "delete",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//角色添加权限
export function put_roleMenuAdd(query) {
  return req({
    url: `/api/roleMenuAdd`,
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//获取菜单列表
export function get_getmenuList(query) {
  return req({
    url: "/api/getParentMenuList",
    method: "get",
    params: query,
  });
}

//根据父级id获取子菜单
export function get_getMenuListByParentId(query) {
  return req({
    url: "/api/getMenuListByParentId",
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//菜单新增
export function put_menuAdd(query) {
  return req({
    url: `/api/menuAdd`,
    method: "put",
    data: qs.stringify(query),

  });
}

//删除菜单
export function put_menuDel(query) {
  return req({
    url: `/api/menuDel`,
    method: "delete",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//删除菜单
export function put_menuEdit(query) {
  return req({
    url: `/api/menuEdit`,
    method: "post",
    data: query,

  });
}

//获取厂家列表
export function get_vendorListByPage(query) {
  return req({
    url: "/api/vendorListByPage",
    method: "get",
    params: query,
  });
}

//新增厂家
export function post_addVendor(query) {
  return req({
    url: "/api/addVendor",
    method: "post",
    data: query,
  });
}

//新增厂家
export function put_editVendor(query) {
  return req({
    url: "/api/editVendor",
    method: "put",
    data: qs.stringify(query),
  });
}


//删除厂家
export function del_delVendor(query) {
  return req({
    url: "/api/delVendor",
    method: "delete",
    headers: {
      'Content-Type': 'application/json'
    },
    data: query,
  });
}







